<?php
return array(
	'defaultScope' => array(
		'condition' => "object_type = 'Native'",
	),
	'attributeLabels' => array(
		'title' => '土特产名称',
	    'create_time' => '添加时间',
		'searchCity' => '产地'
	),

	'relations' => array(
		'profile' => array(CActiveRecord::HAS_ONE, 'GoodsNative', 'goods_id'),
		'type' => array(CActiveRecord::BELONGS_TO, 'GoodsType', 'type_id'),
	),
	'rules' => array(
		array('type_id', 'required'),
		array('field,searchCity','safe'),
		array('type_id','coms.validators.goods.GoodsTypeIdValidator')
	),
	'behaviors' => array(
		'search' => array(
			'class' => 'application.behaviors.SearchBehavior',
			'timeSearch' => 'create_time',
			'priceSearch' => array(
				'attribute' => 'price_dealer',
				'alias' => 'priceInfo',
				'criteria' => array(
					'with' => 'priceInfo',
					'group' => 't.id'
				)
			),
			'noSearchAttributes' => array(
				'type_id'
			),
			'searchModel' => 'NativeSearch'
		),
		'fornt' => array(
			'class' => 'coms.behaviors.FrontBehavior',
			'attributes' => array(
				'title' => 'title',
				'img' => 'thumb'
			),
			'route' => 'provide/channel',
			'view' => 'nativeView'
		),
		'citycondtion' => array(
			'class' => 'application.behaviors.CitySearchCondition',
			'citys' => array(
				'field'
			),
			'with' => array('profile')
		),
		'typeCount' => array(
			'class' => 'coms.behaviors.goods.GoodsTypeCount',
			'goodsTypeModel' => 'GoodsType',
			'countAttr' => 'count',
			'cateAttr' => 'type_id',
			'statusArr' => array(
				array('attribute'=>'listing_status','status'=>'ST_LISTING')
			),
		),
	),
	'class_id' => Goods::TYPE_NATIVE,
	'_import' => array(
		array('*', 'models.Goods//*'),
	),
);